#-------------------------------------------------------------------------------------------------
#REPLICATION FILE FOR: "ENCOURAGING INDONESIANS TO PRAY FROM HOME DURING THE COVID-19 PANDEMIC----
#NICHOLAS KUIPERS, SAIFUL MUJANI, AND THOMAS PEPINSKY---------------------------------------------
#JOURNAL OF EXPERIMENTAL POLITICAL SCIENCE--------------------------------------------------------
#JULY 7, 2020-------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------

#load these packages
library(tidyverse)
library(foreign)
library(magrittr)
library(estimatr)

#clear global environment
rm(list=ls())

#set the working directory to wherever you downloaded the replication file
setwd("~/Dropbox/covid_data/kmp_jeps_replication_file") 

#read in the data
survey_df = read.csv("./data/analysis_data.csv")

#translating---------------------------------------------------------------------

#NOTE that we do NOT use the translated data for the actual analysis. This script
#is just for interested replicators who feel more comfortable using english------

source("./code/1_translating_data.R")

#cleaning------------------------------------------------------------------------

source("./code/1_cleaning_script.R")

#main paper analyses-------------------------------------------------------------

source("./code/2_figure_1.R") #main analysis (H1-H3)

source("./code/2_figure_2.R") #secondary analyses (H4-H7)

#supplementary appendix analyses-------------------------------------------------

source("./code/3_figure_1.R") #power calculations. this takes like ten minutes to run FYI

source("./code/3_figure_2.R") #individual treatment analyses

source("./code/3_figure_3.R") #balance plot



